<?php
include_once 'fns.php';
include_once 'admin_html.php';

if (isset($_GET['org'])) $id_org=$_GET['org'];
else $id_org=NULL;

if (isset($_GET['dep'])) $id_dep=$_GET['dep'];
else $id_dep=NULL;

if (isset($_GET['let'])) $id_let=$_GET['let'];
else $id_let=NULL;

if (isset($_GET['globalsearch'])) $globalsearch=$_GET['globalsearch'];
else $globalsearch=NULL;

display_header('Телефонный справочник');
display_content('<h4>Телефонный справочник Алтайские закрома</h4><br />');
display_form_global_search(modify_emp_tel_array(get_emp_tel_w_dep(0,0)),$globalsearch);
/*org($id_org,NULL);
dep($id_org,$id_dep);
emp($id_dep,$id_org);*/
//display_all();
//pb_view_header(get_org($id_org),  pb_dep($id_org, $id_dep));
$tel_ood[]=$id_org;
$tel_ood[]=$id_dep;
$tel_ood[]=  get_tel_org_or_dep($id_dep, $id_org);
$tel_ood[]=  get_tel_org_or_dep(0, $id_org);
if (is_null($id_let) && is_null($globalsearch)) pb_view_content(pb_org($id_org), pb_emp($id_dep,$id_org,$id_let),get_org($id_org),pb_dep($id_org, $id_dep,$tel_ood[2]),$tel_ood);
else 
    if (is_null($globalsearch)) echo pb_view_content1($id_let,pb_emp($id_dep,$id_org,$id_let),pb_org($id_org));
    else pb_view_content2(pb_org($id_org),privat_card_emp($globalsearch));
display_footer();

?>
